#include <iostream>
#include <vector>
#include <chrono>
#include <iomanip>
using namespace std;


int TriFak(ostream& outs, unsigned int m, unsigned int n)
{
	if (m>n)
	{
		return n;
	}

	for (int i = 0; i < m; i++)
	{
		outs << '*';
	} 
	outs << endl;

	TriFak(outs, m+1, n);


	for (int i = 0; i < m; i++)
	{
		outs << '*';
	}
	outs << endl;
}


void VTriFak(ostream& outs, unsigned int m, unsigned int n)
{
	if (m<=n)
	{
		for (int i = 0; i < m; i++)
		{
			outs << "*";
		} 
		outs << endl;

		TriFak(outs, m+1, n);


		for (int i = 0; i < m; i++)
		{
			outs << "*";
		}
		outs << endl;

	}
}

int main()
{
	int x = 2;
	bool indicator = true;
	while (true)
	{
		if(x >= 80)
		{
			indicator = false;
		}

		if(x <= 2)
		{
			indicator = true;
		}
		VTriFak(cout, 1, x);

		if (indicator)
		{
			x++;
		}
		else
			x--;
	}
	
	cin.get();

	return 0;
}